Clover coverage report - Enterprise Web Services - 1.0
Coverage timestamp: Mon May 30 2005 17:10:32 CEST
file stats: LOC: 116   Methods: 10
NCLOC: 83   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
Ws4J2eeEmitter.java 58.3% 92.1% 100% 86.7%
coverage coverage
 1   
 /*
 2   
  * Copyright 2001-2004 The Apache Software Foundation.
 3   
  * 
 4   
  * Licensed under the Apache License, Version 2.0 (the "License");
 5   
  * you may not use this file except in compliance with the License.
 6   
  * You may obtain a copy of the License at
 7   
  * 
 8   
  *      http://www.apache.org/licenses/LICENSE-2.0
 9   
  * 
 10   
  * Unless required by applicable law or agreed to in writing, software
 11   
  * distributed under the License is distributed on an "AS IS" BASIS,
 12   
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13   
  * See the License for the specific language governing permissions and
 14   
  * limitations under the License.
 15   
  */
 16   
 
 17   
 package org.apache.geronimo.ews.ws4j2ee.toWs;
 18   
 
 19   
 import org.apache.commons.logging.Log;
 20   
 import org.apache.commons.logging.LogFactory;
 21   
 import org.apache.geronimo.ews.ws4j2ee.context.ContextValidator;
 22   
 import org.apache.geronimo.ews.ws4j2ee.context.J2EEWebServiceContext;
 23   
 
 24   
 import java.io.File;
 25   
 
 26   
 /**
 27   
  * @author hemapani@opensource.lk
 28   
  */
 29   
 public class Ws4J2eeEmitter {
 30   
     protected static Log log =
 31   
             LogFactory.getLog(Ws4J2eeEmitter.class.getName());
 32   
     protected Ws4J2eeFactory factory;
 33   
     protected J2EEWebServiceContext wscontext;
 34   
     private boolean ejbBased;
 35   
     private boolean verbose;
 36   
 
 37  11
     public Ws4J2eeEmitter(J2EEWebServiceContext wscontext) {
 38  11
         this.wscontext = wscontext;
 39  11
         this.factory = wscontext.getFactory();
 40  11
         this.ejbBased = wscontext.getMiscInfo().isImplwithEJB();
 41  11
         this.verbose = wscontext.getMiscInfo().isVerbose();
 42   
     }
 43   
 
 44  11
     public void prepareOutPutDir() {
 45  11
         File file = new File(wscontext.getMiscInfo().getOutPutPath() + "/META-INF");
 46  11
         if (!file.exists())
 47  0
             file.mkdirs();
 48   
     }
 49   
 
 50  11
     public void generatedSEIandtypes() throws GenerationFault {
 51  11
         Generator seiAndTypegen =
 52   
                 factory.getGenerationFactory().createServerSideWsGenerator(wscontext);
 53  11
         seiAndTypegen.generate();
 54   
     }
 55   
 
 56  11
     public void validateTheContext() throws GenerationFault {
 57  11
         ContextValidator cvalidater = new ContextValidator(wscontext);
 58  11
         cvalidater.validateWithWSDL();
 59   
     }
 60   
 
 61  8
     public void generateEJB() throws GenerationFault {
 62  8
         if (verbose) {
 63  0
             log.info("genarating ejb >>");
 64   
         }
 65  8
         Generator ejbgen = factory.getGenerationFactory().createEJBGenerator(wscontext);
 66  8
         ejbgen.generate();
 67  8
         if (verbose) {
 68  0
             log.info("genarating j2ee dd >>");
 69   
         }
 70  8
         Generator j2eeContainerDDGen =
 71   
                 factory.getGenerationFactory()
 72   
                 .createContainerSpecificDDGenerator(wscontext);
 73  8
         j2eeContainerDDGen.generate();
 74   
     }
 75   
 
 76  11
     public void generateWrapperWs() throws GenerationFault {
 77  11
         Generator wrapgen =
 78   
                 factory.getGenerationFactory().createWrapperWsGenerator(wscontext);
 79  11
         wrapgen.generate();
 80   
     }
 81   
 
 82  11
     public void generatedHandlers() throws GenerationFault {
 83  11
         Generator handlerGen =
 84   
                 factory.getGenerationFactory().createHandlerGenerator(wscontext);
 85  11
         handlerGen.generate();
 86   
     }
 87   
 
 88  11
     public void generateBuildFile() throws GenerationFault {
 89  11
         Generator buildFileGen =
 90   
                 factory.getGenerationFactory().createBuildFileGenerator(wscontext);
 91  11
         if (buildFileGen != null)
 92  11
             buildFileGen.generate();
 93   
     }
 94   
 
 95  11
     public void executeAnt() throws GenerationFault {
 96  11
         if (wscontext.getMiscInfo().isCompile()) {
 97  11
             org.apache.geronimo.ews.ws4j2ee.utils.AntExecuter executer
 98   
                     = new org.apache.geronimo.ews.ws4j2ee.utils.AntExecuter(wscontext);
 99  11
             executer.execute(wscontext.getMiscInfo().getOutPutPath() + "/build.xml");
 100   
         }
 101   
     }
 102   
 
 103  11
     public void emmit() throws GenerationFault {
 104  11
         prepareOutPutDir();
 105  11
         generatedSEIandtypes();
 106  11
         validateTheContext();
 107  11
         if (ejbBased) {
 108  8
             generateEJB();
 109   
         }
 110  11
         generateWrapperWs();
 111  11
         generatedHandlers();
 112  11
         generateBuildFile();
 113  11
         executeAnt();
 114   
     }
 115   
 }
 116